"""主机发现服务"""
import nmap


nm = nmap.PortScanner()

nm.scan(hosts='192.168.101.8', arguments='-O')

for host in nm.all_hosts():
    print(nm[host].get('osclass'))
    print('Host : %s (%s)' % (host, nm[host].hostname()))
    print('State : %s' % nm[host].state())
